// no 1
#include "Complex.h"
#include <iostream>
#include <stdio.h>
#define SIZE 5
Complex::Complex()
{
	this -> re = 0.0;
	this -> im = 0.0;
}
Complex::Complex(double x, double y)
{
	this -> re = x;
	this -> im = y;
}
Complex::Complex(const Complex *c)
{
	this -> re = c -> re;
	this -> im = c -> im;
}
Complex::Complex(const Complex &c)
{
	this -> re = c.re;
	this -> im = c.im;
}
double Complex::getReal(void) const
{
	return this -> re;
}
double Complex::getImag(void) const
{
	return this -> im;
}
void Complex::setReal(double real)
{
	this -> re = real;
}
void Complex::setImag(double imag)
{
	this -> im = imag;
}
/*Complex::~Complex()
{
	printf("I destroyed(%f, %f).\n", this -> re, this -> im);
}*/
std::istream& operator >> (std::istream &in, Complex &c)
{
	in >> c.re >> c.im;
	return in;
}
std::ostream& operator << (std::ostream &out, Complex c)
{
	out << "(" << c.re << ", " << c.im << "),";
	return out;
}
void Complex::increase(double d)
{
	this -> re += d;
}
void Complex::print(void) const
{
	printf("(%f, %f)", this -> re, this -> im);
}
using namespace std;
int main()
{
	double real = 0.0, imag = 0.0;
	Complex s[SIZE], sum = Complex();
	for (int i = 0; i < SIZE; ++i)
	{
		printf("s[%d] = ", i);
		cin >> s[i];
		real += s[i].getReal();
		imag += s[i].getImag();
		sum.setReal(real);
		sum.setImag(imag);
	}
	cout << sum;
	for (int i = 0; i < SIZE; ++i)
	{	
		s[i].increase(1.0);
		s[i].print();
	}
	return 0;
}